package com.mmc.delay.factory;

import com.mmc.delay.api.Producer;
import com.mmc.delay.api.impl.DelayProducer;
import com.mmc.delay.interceptor.SendInterceptor;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.List;

public class DelayFactory {



    private static DelayProducer delayProducer;

    public static Producer createProducer(RedisTemplate redisTemplate){
        if(delayProducer==null){
            synchronized (DelayFactory.class){
                if(delayProducer==null){
                    delayProducer=new DelayProducer(redisTemplate);
                }
            }
        }
        return delayProducer;
    }

}
